home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DDJMAG / DDJ9310.ZIP / DFPP03.ZIP / CURSOR.H < prev    next >
C/C++ Source or Header  |  1993-09-27  |  965b  |  46 lines

  1. // ------------- cursor.h
  2.  
  3. #ifndef CURSOR_H
  4. #define CURSOR_H
  5.  
  6. // ------- video BIOS (0x10) functions
  7. const int SETCURSORTYPE = 1;
  8. const int SETCURSOR     = 2;
  9. const int READCURSOR    = 3;
  10. const int HIDECURSOR    = 0x20;
  11.  
  12. const int MAXSAVES = 50;  // depth of cursor save/restore stack
  13.  
  14. class Cursor {
  15.     // --- cursor save/restore stack
  16.     int cursorpos[MAXSAVES];
  17.     int cursorshape[MAXSAVES];
  18.     int cs;             // count of cursor saves in effect
  19.     union REGS regs;
  20.     void Cursor::GetCursor();
  21. public:
  22.     Cursor();
  23.     ~Cursor();
  24.     void SetPosition(int x, int y);
  25.     void GetPosition(int &x, int &y);
  26.     void SetType(unsigned t);
  27.     void NormalCursor() { SetType(0x0607); }
  28.     void BoxCursor()    { SetType(0x0107); }
  29.     void Hide();
  30.     void Show();
  31.     void Save();
  32.     void Restore();
  33.     void SwapStack();
  34. };
  35.  
  36. inline void swap(int& a, int& b)
  37. {
  38.     int x = a;
  39.     a = b;
  40.     b = x;
  41. }
  42.  
  43. #endif
  44.  
  45.  
  46.